\(\int \cos ^6(c+d x) (a+b \tan ^2(c+d x))^2 \, dx\) [449]
Optimal result
Integrand size = 23, antiderivative size = 122 \[
\int \cos ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {1}{16} \left (5 a^2+2 a b+b^2\right ) x+\frac {\left (5 a^2+2 a b+b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}+\frac {(a-b) (5 a+3 b) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {(a-b) \cos ^5(c+d x) \sin (c+d x) \left (a+b \tan ^2(c+d x)\right )}{6 d}
\]
[Out]
1/16*(5*a^2+2*a*b+b^2)*x+1/16*(5*a^2+2*a*b+b^2)*cos(d*x+c)*sin(d*x+c)/d+1/24*(a-b)*(5*a+3*b)*cos(d*x+c)^3*sin(
d*x+c)/d+1/6*(a-b)*cos(d*x+c)^5*sin(d*x+c)*(a+b*tan(d*x+c)^2)/d
Rubi [A] (verified)
Time = 0.14 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.00, number of
steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3756, 424, 393, 205, 209}
\[
\int \cos ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {\left (5 a^2+2 a b+b^2\right ) \sin (c+d x) \cos (c+d x)}{16 d}+\frac {1}{16} x \left (5 a^2+2 a b+b^2\right )+\frac {(a-b) (5 a+3 b) \sin (c+d x) \cos ^3(c+d x)}{24 d}+\frac {(a-b) \sin (c+d x) \cos ^5(c+d x) \left (a+b \tan ^2(c+d x)\right )}{6 d}
\]
[In]
Int[Cos[c + d*x]^6*(a + b*Tan[c + d*x]^2)^2,x]
[Out]
((5*a^2 + 2*a*b + b^2)*x)/16 + ((5*a^2 + 2*a*b + b^2)*Cos[c + d*x]*Sin[c + d*x])/(16*d) + ((a - b)*(5*a + 3*b)
*Cos[c + d*x]^3*Sin[c + d*x])/(24*d) + ((a - b)*Cos[c + d*x]^5*Sin[c + d*x]*(a + b*Tan[c + d*x]^2))/(6*d)
Rule 205
Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(-x)*((a + b*x^n)^(p + 1)/(a*n*(p + 1))), x] + Dist[(n*(p
+ 1) + 1)/(a*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && LtQ[p, -1] && (
IntegerQ[2*p] || (n == 2 && IntegerQ[4*p]) || (n == 2 && IntegerQ[3*p]) || Denominator[p + 1/n] < Denominator[
p])
Rule 209
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])
Rule 393
Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(-(b*c - a*d))*x*((a + b*x^n)^(p
+ 1)/(a*b*n*(p + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x]
/; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])
Rule 424
Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(a*d - c*b)*x*(a + b*x^n)^(
p + 1)*((c + d*x^n)^(q - 1)/(a*b*n*(p + 1))), x] - Dist[1/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1)*(c + d*x^n)
^(q - 2)*Simp[c*(a*d - c*b*(n*(p + 1) + 1)) + d*(a*d*(n*(q - 1) + 1) - b*c*(n*(p + q) + 1))*x^n, x], x], x] /;
FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, n, p, q
, x]
Rule 3756
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/(c^(m - 1)*f), Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)
^n)^p, x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2] && (IntegersQ[n, p
] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])
Rubi steps \begin{align*}
\text {integral}& = \frac {\text {Subst}\left (\int \frac {\left (a+b x^2\right )^2}{\left (1+x^2\right )^4} \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {(a-b) \cos ^5(c+d x) \sin (c+d x) \left (a+b \tan ^2(c+d x)\right )}{6 d}+\frac {\text {Subst}\left (\int \frac {a (5 a+b)+3 b (a+b) x^2}{\left (1+x^2\right )^3} \, dx,x,\tan (c+d x)\right )}{6 d} \\ & = \frac {(a-b) (5 a+3 b) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {(a-b) \cos ^5(c+d x) \sin (c+d x) \left (a+b \tan ^2(c+d x)\right )}{6 d}+\frac {\left (5 a^2+2 a b+b^2\right ) \text {Subst}\left (\int \frac {1}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{8 d} \\ & = \frac {\left (5 a^2+2 a b+b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}+\frac {(a-b) (5 a+3 b) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {(a-b) \cos ^5(c+d x) \sin (c+d x) \left (a+b \tan ^2(c+d x)\right )}{6 d}+\frac {\left (5 a^2+2 a b+b^2\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{16 d} \\ & = \frac {1}{16} \left (5 a^2+2 a b+b^2\right ) x+\frac {\left (5 a^2+2 a b+b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}+\frac {(a-b) (5 a+3 b) \cos ^3(c+d x) \sin (c+d x)}{24 d}+\frac {(a-b) \cos ^5(c+d x) \sin (c+d x) \left (a+b \tan ^2(c+d x)\right )}{6 d} \\
\end{align*}
Mathematica [C] (verified)
Result contains complex when optimal does not.
Time = 1.32 (sec) , antiderivative size = 87, normalized size of antiderivative = 0.71
\[
\int \cos ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {12 ((1-2 i) a+b) ((1+2 i) a+b) (c+d x)+3 (5 a-b) (3 a+b) \sin (2 (c+d x))+3 (a-b) (3 a+b) \sin (4 (c+d x))+(a-b)^2 \sin (6 (c+d x))}{192 d}
\]
[In]
Integrate[Cos[c + d*x]^6*(a + b*Tan[c + d*x]^2)^2,x]
[Out]
(12*((1 - 2*I)*a + b)*((1 + 2*I)*a + b)*(c + d*x) + 3*(5*a - b)*(3*a + b)*Sin[2*(c + d*x)] + 3*(a - b)*(3*a +
b)*Sin[4*(c + d*x)] + (a - b)^2*Sin[6*(c + d*x)])/(192*d)
Maple [A] (verified)
Time = 27.96 (sec) , antiderivative size = 166, normalized size of antiderivative =
1.36
| | |
method | result | size |
| | |
derivativedivides |
\(\frac {b^{2} \left (-\frac {\sin \left (d x +c \right )^{3} \cos \left (d x +c \right )^{3}}{6}-\frac {\cos \left (d x +c \right )^{3} \sin \left (d x +c \right )}{8}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{16}+\frac {d x}{16}+\frac {c}{16}\right )+2 a b \left (-\frac {\cos \left (d x +c \right )^{5} \sin \left (d x +c \right )}{6}+\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{24}+\frac {d x}{16}+\frac {c}{16}\right )+a^{2} \left (\frac {\left (\cos \left (d x +c \right )^{5}+\frac {5 \cos \left (d x +c \right )^{3}}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )}{d}\) |
\(166\) |
default |
\(\frac {b^{2} \left (-\frac {\sin \left (d x +c \right )^{3} \cos \left (d x +c \right )^{3}}{6}-\frac {\cos \left (d x +c \right )^{3} \sin \left (d x +c \right )}{8}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{16}+\frac {d x}{16}+\frac {c}{16}\right )+2 a b \left (-\frac {\cos \left (d x +c \right )^{5} \sin \left (d x +c \right )}{6}+\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{24}+\frac {d x}{16}+\frac {c}{16}\right )+a^{2} \left (\frac {\left (\cos \left (d x +c \right )^{5}+\frac {5 \cos \left (d x +c \right )^{3}}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )}{d}\) |
\(166\) |
risch |
\(\frac {5 x \,a^{2}}{16}+\frac {x a b}{8}+\frac {x \,b^{2}}{16}+\frac {\sin \left (6 d x +6 c \right ) a^{2}}{192 d}-\frac {\sin \left (6 d x +6 c \right ) a b}{96 d}+\frac {\sin \left (6 d x +6 c \right ) b^{2}}{192 d}+\frac {3 \sin \left (4 d x +4 c \right ) a^{2}}{64 d}-\frac {\sin \left (4 d x +4 c \right ) a b}{32 d}-\frac {\sin \left (4 d x +4 c \right ) b^{2}}{64 d}+\frac {15 \sin \left (2 d x +2 c \right ) a^{2}}{64 d}+\frac {\sin \left (2 d x +2 c \right ) a b}{32 d}-\frac {\sin \left (2 d x +2 c \right ) b^{2}}{64 d}\) |
\(169\) |
| | |
|
|
|
[In]
int(cos(d*x+c)^6*(a+b*tan(d*x+c)^2)^2,x,method=_RETURNVERBOSE)
[Out]
1/d*(b^2*(-1/6*sin(d*x+c)^3*cos(d*x+c)^3-1/8*cos(d*x+c)^3*sin(d*x+c)+1/16*cos(d*x+c)*sin(d*x+c)+1/16*d*x+1/16*
c)+2*a*b*(-1/6*cos(d*x+c)^5*sin(d*x+c)+1/24*(cos(d*x+c)^3+3/2*cos(d*x+c))*sin(d*x+c)+1/16*d*x+1/16*c)+a^2*(1/6
*(cos(d*x+c)^5+5/4*cos(d*x+c)^3+15/8*cos(d*x+c))*sin(d*x+c)+5/16*d*x+5/16*c))
Fricas [A] (verification not implemented)
none
Time = 0.27 (sec) , antiderivative size = 98, normalized size of antiderivative = 0.80
\[
\int \cos ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {3 \, {\left (5 \, a^{2} + 2 \, a b + b^{2}\right )} d x + {\left (8 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{5} + 2 \, {\left (5 \, a^{2} + 2 \, a b - 7 \, b^{2}\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (5 \, a^{2} + 2 \, a b + b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{48 \, d}
\]
[In]
integrate(cos(d*x+c)^6*(a+b*tan(d*x+c)^2)^2,x, algorithm="fricas")
[Out]
1/48*(3*(5*a^2 + 2*a*b + b^2)*d*x + (8*(a^2 - 2*a*b + b^2)*cos(d*x + c)^5 + 2*(5*a^2 + 2*a*b - 7*b^2)*cos(d*x
+ c)^3 + 3*(5*a^2 + 2*a*b + b^2)*cos(d*x + c))*sin(d*x + c))/d
Sympy [F]
\[
\int \cos ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\int \left (a + b \tan ^{2}{\left (c + d x \right )}\right )^{2} \cos ^{6}{\left (c + d x \right )}\, dx
\]
[In]
integrate(cos(d*x+c)**6*(a+b*tan(d*x+c)**2)**2,x)
[Out]
Integral((a + b*tan(c + d*x)**2)**2*cos(c + d*x)**6, x)
Maxima [A] (verification not implemented)
none
Time = 0.31 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.07
\[
\int \cos ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\frac {3 \, {\left (5 \, a^{2} + 2 \, a b + b^{2}\right )} {\left (d x + c\right )} + \frac {3 \, {\left (5 \, a^{2} + 2 \, a b + b^{2}\right )} \tan \left (d x + c\right )^{5} + 8 \, {\left (5 \, a^{2} + 2 \, a b - b^{2}\right )} \tan \left (d x + c\right )^{3} + 3 \, {\left (11 \, a^{2} - 2 \, a b - b^{2}\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{6} + 3 \, \tan \left (d x + c\right )^{4} + 3 \, \tan \left (d x + c\right )^{2} + 1}}{48 \, d}
\]
[In]
integrate(cos(d*x+c)^6*(a+b*tan(d*x+c)^2)^2,x, algorithm="maxima")
[Out]
1/48*(3*(5*a^2 + 2*a*b + b^2)*(d*x + c) + (3*(5*a^2 + 2*a*b + b^2)*tan(d*x + c)^5 + 8*(5*a^2 + 2*a*b - b^2)*ta
n(d*x + c)^3 + 3*(11*a^2 - 2*a*b - b^2)*tan(d*x + c))/(tan(d*x + c)^6 + 3*tan(d*x + c)^4 + 3*tan(d*x + c)^2 +
1))/d
Giac [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 4487 vs. \(2 (114) = 228\).
Time = 23.36 (sec) , antiderivative size = 4487, normalized size of antiderivative = 36.78
\[
\int \cos ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=\text {Too large to display}
\]
[In]
integrate(cos(d*x+c)^6*(a+b*tan(d*x+c)^2)^2,x, algorithm="giac")
[Out]
1/48*(3*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*
tan(c))*tan(d*x)^6*tan(c)^6 + 15*a^2*d*x*tan(d*x)^6*tan(c)^6 + 6*a*b*d*x*tan(d*x)^6*tan(c)^6 + 3*b^2*d*x*tan(d
*x)^6*tan(c)^6 + 3*pi*a*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6*t
an(c)^6 + 9*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x)
- 2*tan(c))*tan(d*x)^6*tan(c)^4 + 9*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x
)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^6 + 6*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) -
1))*tan(d*x)^6*tan(c)^6 - 6*a*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^6*tan(c)^6 + 45*a^
2*d*x*tan(d*x)^6*tan(c)^4 + 18*a*b*d*x*tan(d*x)^6*tan(c)^4 + 9*b^2*d*x*tan(d*x)^6*tan(c)^4 + 9*pi*a*b*sgn(-2*t
an(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6*tan(c)^4 + 45*a^2*d*x*tan(d*x)^4*ta
n(c)^6 + 18*a*b*d*x*tan(d*x)^4*tan(c)^6 + 9*b^2*d*x*tan(d*x)^4*tan(c)^6 + 9*pi*a*b*sgn(-2*tan(d*x)^2*tan(c) +
2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^6 + 9*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn
(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6*tan(c)^2 + 27*pi*a*b*sgn(2*tan
(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c
)^4 + 18*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^6*tan(c)^4 - 18*a*b*arctan(-(tan(d*x)
- tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^6*tan(c)^4 - 33*a^2*tan(d*x)^6*tan(c)^5 + 6*a*b*tan(d*x)^6*tan(c)^5
+ 3*b^2*tan(d*x)^6*tan(c)^5 + 9*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*ta
n(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^6 + 18*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))
*tan(d*x)^4*tan(c)^6 - 18*a*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^4*tan(c)^6 - 33*a^2*
tan(d*x)^5*tan(c)^6 + 6*a*b*tan(d*x)^5*tan(c)^6 + 3*b^2*tan(d*x)^5*tan(c)^6 + 45*a^2*d*x*tan(d*x)^6*tan(c)^2 +
18*a*b*d*x*tan(d*x)^6*tan(c)^2 + 9*b^2*d*x*tan(d*x)^6*tan(c)^2 + 9*pi*a*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*
x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6*tan(c)^2 + 135*a^2*d*x*tan(d*x)^4*tan(c)^4 + 54*a*b*d*x*tan(d*
x)^4*tan(c)^4 + 27*b^2*d*x*tan(d*x)^4*tan(c)^4 + 27*pi*a*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*
tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^4 + 45*a^2*d*x*tan(d*x)^2*tan(c)^6 + 18*a*b*d*x*tan(d*x)^2*tan(c)^6 + 9
*b^2*d*x*tan(d*x)^2*tan(c)^6 + 9*pi*a*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c)
)*tan(d*x)^2*tan(c)^6 + 3*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2
+ 2*tan(d*x) - 2*tan(c))*tan(d*x)^6 + 27*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*t
an(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^2 + 18*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*ta
n(c) - 1))*tan(d*x)^6*tan(c)^2 - 18*a*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^6*tan(c)^2
- 40*a^2*tan(d*x)^6*tan(c)^3 - 16*a*b*tan(d*x)^6*tan(c)^3 + 8*b^2*tan(d*x)^6*tan(c)^3 + 27*pi*a*b*sgn(2*tan(d
*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^
4 + 54*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^4*tan(c)^4 - 54*a*b*arctan(-(tan(d*x) -
tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^4*tan(c)^4 + 45*a^2*tan(d*x)^5*tan(c)^4 - 78*a*b*tan(d*x)^5*tan(c)^4 +
9*b^2*tan(d*x)^5*tan(c)^4 + 45*a^2*tan(d*x)^4*tan(c)^5 - 78*a*b*tan(d*x)^4*tan(c)^5 + 9*b^2*tan(d*x)^4*tan(c)
^5 + 3*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*t
an(c))*tan(c)^6 + 18*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^2*tan(c)^6 - 18*a*b*arctan
(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^2*tan(c)^6 - 40*a^2*tan(d*x)^3*tan(c)^6 - 16*a*b*tan(d*x
)^3*tan(c)^6 + 8*b^2*tan(d*x)^3*tan(c)^6 + 15*a^2*d*x*tan(d*x)^6 + 6*a*b*d*x*tan(d*x)^6 + 3*b^2*d*x*tan(d*x)^6
+ 3*pi*a*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^6 + 135*a^2*d*x*t
an(d*x)^4*tan(c)^2 + 54*a*b*d*x*tan(d*x)^4*tan(c)^2 + 27*b^2*d*x*tan(d*x)^4*tan(c)^2 + 27*pi*a*b*sgn(-2*tan(d*
x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^2 + 135*a^2*d*x*tan(d*x)^2*tan(c)
^4 + 54*a*b*d*x*tan(d*x)^2*tan(c)^4 + 27*b^2*d*x*tan(d*x)^2*tan(c)^4 + 27*pi*a*b*sgn(-2*tan(d*x)^2*tan(c) + 2*
tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^4 + 15*a^2*d*x*tan(c)^6 + 6*a*b*d*x*tan(c)^6 + 3*
b^2*d*x*tan(c)^6 + 3*pi*a*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(c)^6 +
9*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c
))*tan(d*x)^4 + 6*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^6 - 6*a*b*arctan(-(tan(d*x) -
tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^6 - 15*a^2*tan(d*x)^6*tan(c) - 6*a*b*tan(d*x)^6*tan(c) - 3*b^2*tan(d*
x)^6*tan(c) + 27*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(
d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^2 + 54*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^4*tan
(c)^2 - 54*a*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^4*tan(c)^2 + 45*a^2*tan(d*x)^5*tan(
c)^2 + 18*a*b*tan(d*x)^5*tan(c)^2 - 39*b^2*tan(d*x)^5*tan(c)^2 - 120*a^2*tan(d*x)^4*tan(c)^3 + 144*a*b*tan(d*x
)^4*tan(c)^3 - 72*b^2*tan(d*x)^4*tan(c)^3 + 9*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) +
2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(c)^4 + 54*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) -
1))*tan(d*x)^2*tan(c)^4 - 54*a*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^2*tan(c)^4 - 120*
a^2*tan(d*x)^3*tan(c)^4 + 144*a*b*tan(d*x)^3*tan(c)^4 - 72*b^2*tan(d*x)^3*tan(c)^4 + 45*a^2*tan(d*x)^2*tan(c)^
5 + 18*a*b*tan(d*x)^2*tan(c)^5 - 39*b^2*tan(d*x)^2*tan(c)^5 + 6*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c
) - 1))*tan(c)^6 - 6*a*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(c)^6 - 15*a^2*tan(d*x)*tan(c)^
6 - 6*a*b*tan(d*x)*tan(c)^6 - 3*b^2*tan(d*x)*tan(c)^6 + 45*a^2*d*x*tan(d*x)^4 + 18*a*b*d*x*tan(d*x)^4 + 9*b^2*
d*x*tan(d*x)^4 + 9*pi*a*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4 +
135*a^2*d*x*tan(d*x)^2*tan(c)^2 + 54*a*b*d*x*tan(d*x)^2*tan(c)^2 + 27*b^2*d*x*tan(d*x)^2*tan(c)^2 + 27*pi*a*b
*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2*tan(c)^2 + 45*a^2*d*x*tan(
c)^4 + 18*a*b*d*x*tan(c)^4 + 9*b^2*d*x*tan(c)^4 + 9*pi*a*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*
tan(d*x) - 2*tan(c))*tan(c)^4 + 9*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*
tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^2 + 18*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*
x)^4 - 18*a*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^4 + 15*a^2*tan(d*x)^5 + 6*a*b*tan(d*
x)^5 + 3*b^2*tan(d*x)^5 - 45*a^2*tan(d*x)^4*tan(c) - 18*a*b*tan(d*x)^4*tan(c) + 39*b^2*tan(d*x)^4*tan(c) + 9*p
i*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*t
an(c)^2 + 54*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^2*tan(c)^2 - 54*a*b*arctan(-(tan(d
*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^2*tan(c)^2 + 120*a^2*tan(d*x)^3*tan(c)^2 - 144*a*b*tan(d*x)^3*ta
n(c)^2 + 72*b^2*tan(d*x)^3*tan(c)^2 + 120*a^2*tan(d*x)^2*tan(c)^3 - 144*a*b*tan(d*x)^2*tan(c)^3 + 72*b^2*tan(d
*x)^2*tan(c)^3 + 18*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(c)^4 - 18*a*b*arctan(-(tan(d*x)
- tan(c))/(tan(d*x)*tan(c) + 1))*tan(c)^4 - 45*a^2*tan(d*x)*tan(c)^4 - 18*a*b*tan(d*x)*tan(c)^4 + 39*b^2*tan(d
*x)*tan(c)^4 + 15*a^2*tan(c)^5 + 6*a*b*tan(c)^5 + 3*b^2*tan(c)^5 + 45*a^2*d*x*tan(d*x)^2 + 18*a*b*d*x*tan(d*x)
^2 + 9*b^2*d*x*tan(d*x)^2 + 9*pi*a*b*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*t
an(d*x)^2 + 45*a^2*d*x*tan(c)^2 + 18*a*b*d*x*tan(c)^2 + 9*b^2*d*x*tan(c)^2 + 9*pi*a*b*sgn(-2*tan(d*x)^2*tan(c)
+ 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(c)^2 + 3*pi*a*b*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(
d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c)) + 18*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan
(c) - 1))*tan(d*x)^2 - 18*a*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^2 + 40*a^2*tan(d*x)^
3 + 16*a*b*tan(d*x)^3 - 8*b^2*tan(d*x)^3 - 45*a^2*tan(d*x)^2*tan(c) + 78*a*b*tan(d*x)^2*tan(c) - 9*b^2*tan(d*x
)^2*tan(c) + 18*a*b*arctan((tan(d*x) + tan(c))/(tan(d*x)*tan(c) - 1))*tan(c)^2 - 18*a*b*arctan(-(tan(d*x) - ta
n(c))/(tan(d*x)*tan(c) + 1))*tan(c)^2 - 45*a^2*tan(d*x)*tan(c)^2 + 78*a*b*tan(d*x)*tan(c)^2 - 9*b^2*tan(d*x)*t
an(c)^2 + 40*a^2*tan(c)^3 + 16*a*b*tan(c)^3 - 8*b^2*tan(c)^3 + 15*a^2*d*x + 6*a*b*d*x + 3*b^2*d*x + 3*pi*a*b*s
gn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c)) + 6*a*b*arctan((tan(d*x) + tan(c))/(tan
(d*x)*tan(c) - 1)) - 6*a*b*arctan(-(tan(d*x) - tan(c))/(tan(d*x)*tan(c) + 1)) + 33*a^2*tan(d*x) - 6*a*b*tan(d*
x) - 3*b^2*tan(d*x) + 33*a^2*tan(c) - 6*a*b*tan(c) - 3*b^2*tan(c))/(d*tan(d*x)^6*tan(c)^6 + 3*d*tan(d*x)^6*tan
(c)^4 + 3*d*tan(d*x)^4*tan(c)^6 + 3*d*tan(d*x)^6*tan(c)^2 + 9*d*tan(d*x)^4*tan(c)^4 + 3*d*tan(d*x)^2*tan(c)^6
+ d*tan(d*x)^6 + 9*d*tan(d*x)^4*tan(c)^2 + 9*d*tan(d*x)^2*tan(c)^4 + d*tan(c)^6 + 3*d*tan(d*x)^4 + 9*d*tan(d*x
)^2*tan(c)^2 + 3*d*tan(c)^4 + 3*d*tan(d*x)^2 + 3*d*tan(c)^2 + d)
Mupad [B] (verification not implemented)
Time = 13.03 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.03
\[
\int \cos ^6(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx=x\,\left (\frac {5\,a^2}{16}+\frac {a\,b}{8}+\frac {b^2}{16}\right )+\frac {\left (\frac {5\,a^2}{16}+\frac {a\,b}{8}+\frac {b^2}{16}\right )\,{\mathrm {tan}\left (c+d\,x\right )}^5+\left (\frac {5\,a^2}{6}+\frac {a\,b}{3}-\frac {b^2}{6}\right )\,{\mathrm {tan}\left (c+d\,x\right )}^3+\left (\frac {11\,a^2}{16}-\frac {a\,b}{8}-\frac {b^2}{16}\right )\,\mathrm {tan}\left (c+d\,x\right )}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^6+3\,{\mathrm {tan}\left (c+d\,x\right )}^4+3\,{\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}
\]
[In]
int(cos(c + d*x)^6*(a + b*tan(c + d*x)^2)^2,x)
[Out]
x*((a*b)/8 + (5*a^2)/16 + b^2/16) + (tan(c + d*x)^3*((a*b)/3 + (5*a^2)/6 - b^2/6) - tan(c + d*x)*((a*b)/8 - (1
1*a^2)/16 + b^2/16) + tan(c + d*x)^5*((a*b)/8 + (5*a^2)/16 + b^2/16))/(d*(3*tan(c + d*x)^2 + 3*tan(c + d*x)^4
+ tan(c + d*x)^6 + 1))